﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShopExpensList.aspx.cs" Inherits="ShopExpensList" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>店铺垫支费用</title>
    <script src="../js/extTools.js" type="text/javascript"></script>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var edit2 = function (editor, e) {

            // Call DirectMethod
            if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
                CompanyX.Edit2(e.record.data.PID, e.field, e.originalValue, e.value, e.record.data);
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Crisp" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server" Layout="ColumnLayout">
                            <Items>
                                <ext:DateField runat="server" ID="txtbdate" FieldLabel="开始日期" />
                                <ext:DateField runat="server" ID="txtedate" FieldLabel="结束日期" />
                                <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Component ID="Component2" runat="server" Width="1500" Padding="5" />
                                <ext:TextField runat="server" ID="txtshop" FieldLabel="店铺" EmptyText="输入店铺名称/代码" />
                                <ext:Button ID="Button3" runat="server" Text="确认费用" UI="Success">
                                    <DirectEvents>
                                        <Click Before="if(#{GridPanel1}.getSelectionModel().getCount()==0){
                                            Ext.Msg.alert('提示信息','请您至少选择一个店铺!');return false;}" OnEvent="BtnExpenCheck">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Button ID="Button4" runat="server" Text="删除费用" UI="Danger">
                                    <DirectEvents>
                                        <Click Before="if(#{GridPanel1}.getSelectionModel().getCount()==0){
                                            Ext.Msg.alert('提示信息','请您至少选择一个店铺!');return false;}" OnEvent="BtnDelExpen">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="RefreshDataSet"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="PID">
                                    <Fields>
                                        <ext:ModelField Name="PID" Mapping="PID" />
                                        <ext:ModelField Name="checkstate" Mapping="状态" />
                                        <ext:ModelField Name="ShopCode" Mapping="店铺代码" />
                                        <ext:ModelField Name="ShopName" Mapping="店铺简称" />
                                        <ext:ModelField Name="PayDate" Mapping="确认日期" />
                                        <ext:ModelField Name="PayMoney" Mapping="金额" />
                                        <ext:ModelField Name="Remark" Mapping="备注" />
                                        <ext:ModelField Name="CreateDate" Mapping="录入日期" />
                                        <ext:ModelField Name="ModifyDate" Mapping="修改时间" />
                                        <ext:ModelField Name="ModifyUser" Mapping="修改人" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Items>
                            <ext:Column ID="Column9" runat="server" Text="状态" DataIndex="checkstate" Width="80">
                                <Renderer Fn="changesate" />
                            </ext:Column>
                            <ext:Column ID="Column1" runat="server" Text="店铺代码" DataIndex="ShopCode" Width="80" />
                            <ext:Column ID="Column2" runat="server" Text="店铺简称" DataIndex="ShopName" Width="180" />
                            <ext:Column ID="Column3" runat="server" Text="确认日期" DataIndex="PayDate" Width="120">
                                <Renderer Fn="date2" />
                                <Editor>
                                    <ext:TextField ID="TextField2" runat="server" EmptyText="输入日期" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column4" runat="server" Text="金额" DataIndex="PayMoney" Width="80">
                                <Editor>
                                    <ext:TextField runat="server" EmptyText="输入金额" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column5" runat="server" Text="备注" DataIndex="Remark" Width="150">
                                <Editor>
                                    <ext:TextField ID="TextField1" runat="server" EmptyText="备注" />
                                </Editor>
                            </ext:Column>
                            <ext:Column ID="Column6" runat="server" Text="录入日期" DataIndex="CreateDate" Width="180" />
                            <ext:Column ID="Column7" runat="server" Text="修改日期" DataIndex="ModifyDate" Width="180" />
                            <ext:Column ID="Column8" runat="server" Text="修改人" DataIndex="ModifyUser" Width="80" />
                        </Items>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:CheckboxSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <Plugins>
                        <ext:CellEditing ID="CellEditing1" runat="server">
                            <Listeners>
                                <Edit Fn="edit2" />
                            </Listeners>
                        </ext:CellEditing>
                    </Plugins>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="10" />
                                        <ext:ListItem Text="20" />
                                        <ext:ListItem Text="50" />
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="50" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
